/*
 * Stone.java
 *
 * Created on 2007. mC!rcius 12., 16:49
 *
 */

package laborhazi;

/**
 * Stone, it blocks the way
 * @author nyuszik
 */
public class Stone extends FieldElement {
    private Field map;
    private int[] position;
    private boolean nomap = false;
    /** Creates a new instance of Stone
     * @param home the Field
     */
    public Stone setNomap() {
    	nomap = true;
    	return this;
    }
    public boolean getNomap() {
    	
    	return nomap;
    }
    public Stone(Field home) {
        map = home;
        position = new int[2];
    }
    
    public String toString() {
    	return("stone: " + position[0] + " " + position[1]);
    }
    /** 
     * The stone is drilled
     */
    public void drilled() {
        erase();
    }
    /** 
     * The stone is blown up
     */
    public void blow() {
    	erase();
    }
    protected void erase() {
    	map.remove(this, position);
    }
    public void setPos(int[] poss) {
    	position[0] = poss[0];
     	position[1] = poss[1];
     }
    public int[] getPosition() {
        return(position);
    }
}
